package service;

import robot.RobotAgent;
import com.agentfactory.logic.agent.Actuator;
import com.agentfactory.logic.lang.FOS;

public class TurnGunActuator extends Actuator {
	@Override
	public boolean act(FOS action) {
        double angle = 0;
        angle = Double.parseDouble(action.argAt(0).toString());

		RobotAgentService robotAgentService = (RobotAgentService)this.getService(ServiceConstants.SERVICE_NAME);
        if (robotAgentService == null) {
            return false;
        }
		RobotAgent robot = robotAgentService.lookupRobotAgent(this.agent.getName());
		
        robot.gunAngle = angle;

        return true;
	}
}
